package router

import (
	"github.com/gin-gonic/gin"
	"shop-security/preAuthorize"
	"shop-sys/controller"
)

func PrivateSysRole(router *gin.RouterGroup) {
	api := &controller.SysRoleController{}
	sysRoleRouter := router.Group("/sys/role")
	{
		sysRoleRouter.GET("/page", preAuthorize.HasPermission("sys:role:page"), api.Page)         // 角色列表
		sysRoleRouter.GET("/list", preAuthorize.HasPermission("sys:role:list"), api.List)         // 全部角色列表
		sysRoleRouter.GET("/info/:roleId", preAuthorize.HasPermission("sys:role:info"), api.Info) //角色信息
		sysRoleRouter.POST("", preAuthorize.HasPermission("sys:role:save"), api.Save)             // 保存角色
		sysRoleRouter.PUT("", preAuthorize.HasPermission("sys:role:update"), api.Update)          //修改角色
		sysRoleRouter.DELETE("", preAuthorize.HasPermission("sys:role:delete"), api.Delete)       //删除角色
	}
}
